trigger ContractProductTrigger on ContractProduct__c(after update, before insert ,before update   ) {
    //在合同仪器更新的时候 如果全部安装完成则 终端业务机会完结
    if(trigger.isAfter && trigger.isUpdate) ContractProductHandler.finishOpportunity(trigger.new, trigger.oldMap);

    if(trigger.isBefore )ContractProductHandler.updateNum(trigger.new);
}